<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="首页标题" prop="indexTitle">
        <el-input
          v-model="queryParams.indexTitle"
          placeholder="请输入首页标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="按钮_A" prop="btnA">
        <el-input
          v-model="queryParams.btnA"
          placeholder="请输入按钮_A"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按钮_B" prop="btnB">
        <el-input
          v-model="queryParams.btnB"
          placeholder="请输入按钮_B"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按钮_C" prop="btnC">
        <el-input
          v-model="queryParams.btnC"
          placeholder="请输入按钮_C"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按钮_D" prop="btnD">
        <el-input
          v-model="queryParams.btnD"
          placeholder="请输入按钮_D"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按钮_E" prop="btnE">
        <el-input
          v-model="queryParams.btnE"
          placeholder="请输入按钮_E"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="按钮_F" prop="btnF">
        <el-input
          v-model="queryParams.btnF"
          placeholder="请输入按钮_F"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="把舵定向大标题" prop="steeringTitle">
        <el-input
          v-model="queryParams.steeringTitle"
          placeholder="请输入把舵定向大标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="把舵定向小标题" prop="steeringSlogan">
        <el-input
          v-model="queryParams.steeringSlogan"
          placeholder="请输入把舵定向小标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="把舵定向标题A" prop="steeringTitleA">
        <el-input
          v-model="queryParams.steeringTitleA"
          placeholder="请输入把舵定向标题A"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="把舵定向标题B" prop="steeringTitleB">
        <el-input
          v-model="queryParams.steeringTitleB"
          placeholder="请输入把舵定向标题B"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="把舵定向标题C" prop="steeringTitleC">
        <el-input
          v-model="queryParams.steeringTitleC"
          placeholder="请输入把舵定向标题C"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="培根铸魂首页大标题" prop="soulCastingIndexMainTitle">
        <el-input
          v-model="queryParams.soulCastingIndexMainTitle"
          placeholder="请输入培根铸魂首页大标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="培根铸魂首页小标题" prop="soulCastingIndexSubTitle">
        <el-input
          v-model="queryParams.soulCastingIndexSubTitle"
          placeholder="请输入培根铸魂首页小标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="培根铸魂第1页标题" prop="soulCastingPage1Title">
        <el-input
          v-model="queryParams.soulCastingPage1Title"
          placeholder="请输入培根铸魂第1页标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="培根铸魂第2页标题A" prop="soulCastingPage2TitleA">
        <el-input
          v-model="queryParams.soulCastingPage2TitleA"
          placeholder="请输入培根铸魂第2页标题A"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="培根铸魂第2页标题B" prop="soulCastingPage2TitleB">
        <el-input
          v-model="queryParams.soulCastingPage2TitleB"
          placeholder="请输入培根铸魂第2页标题B"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="培根铸魂第3页标题" prop="soulCastingPage3Title">
        <el-input
          v-model="queryParams.soulCastingPage3Title"
          placeholder="请输入培根铸魂第3页标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="强基固本大标题" prop="foundationStrengtheningMainTitle">
        <el-input
          v-model="queryParams.foundationStrengtheningMainTitle"
          placeholder="请输入强基固本大标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="强基固本小标题" prop="foundationStrengtheningSubTitle">
        <el-input
          v-model="queryParams.foundationStrengtheningSubTitle"
          placeholder="请输入强基固本小标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="强基固本标题A" prop="foundationStrengtheningTitleA">
        <el-input
          v-model="queryParams.foundationStrengtheningTitleA"
          placeholder="请输入强基固本标题A"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="强基固本标题B" prop="foundationStrengtheningTitleB">
        <el-input
          v-model="queryParams.foundationStrengtheningTitleB"
          placeholder="请输入强基固本标题B"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="强基固本标题C" prop="foundationStrengtheningTitleC">
        <el-input
          v-model="queryParams.foundationStrengtheningTitleC"
          placeholder="请输入强基固本标题C"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="强基固本标题D" prop="foundationStrengtheningTitleD">
        <el-input
          v-model="queryParams.foundationStrengtheningTitleD"
          placeholder="请输入强基固本标题D"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="凝心聚力大标题" prop="cohesionBigTitle">
        <el-input
          v-model="queryParams.cohesionBigTitle"
          placeholder="请输入凝心聚力大标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="凝心聚力小标题" prop="cohesionSubTitle">
        <el-input
          v-model="queryParams.cohesionSubTitle"
          placeholder="请输入凝心聚力小标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="提质增效" prop="efficiencyImprovement">
        <el-input
          v-model="queryParams.efficiencyImprovement"
          placeholder="请输入提质增效"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="提质增效标题" prop="efficiencyImprovementSlogan">
        <el-input
          v-model="queryParams.efficiencyImprovementSlogan"
          placeholder="请输入提质增效标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="提质增效小标题" prop="efficiencyImprovementMainTitle">
        <el-input
          v-model="queryParams.efficiencyImprovementMainTitle"
          placeholder="请输入提质增效小标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item> 
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['dash:building:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['dash:building:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['dash:building:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['dash:building:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="buildingList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <!-- <el-table-column label="自增主键，唯一标识每条记录" align="center" prop="id" /> -->
      <el-table-column label="党建首页背景" align="center" prop="partyBuildingIndexBg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.partyBuildingIndexBg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="首页标题" align="center" prop="indexTitle" show-overflow-tooltip/>
      <el-table-column label="首页内容" align="center" prop="indexContent" show-overflow-tooltip/>
      <el-table-column label="党建首页按钮背景图" align="center" prop="indexBtnBg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.indexBtnBg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="按钮_A" align="center" prop="btnA" show-overflow-tooltip/>
      <el-table-column label="按钮_B" align="center" prop="btnB" show-overflow-tooltip/>
      <el-table-column label="按钮_C" align="center" prop="btnC" show-overflow-tooltip/>
      <el-table-column label="按钮_D" align="center" prop="btnD" show-overflow-tooltip/>
      <el-table-column label="按钮_E" align="center" prop="btnE" show-overflow-tooltip/>
      <el-table-column label="按钮_F" align="center" prop="btnF" show-overflow-tooltip/>
      <el-table-column label="把舵定向背景图" align="center" prop="steeringBg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.steeringBg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="把舵定向大标题" align="center" prop="steeringTitle" show-overflow-tooltip/>
      <el-table-column label="把舵定向小标题" align="center" prop="steeringSlogan" show-overflow-tooltip/>
      <el-table-column label="把舵定向标题A" align="center" prop="steeringTitleA" show-overflow-tooltip/>
      <el-table-column label="标题内容" align="center" prop="steeringContentA" show-overflow-tooltip/>
      <el-table-column label="把舵定向标题B" align="center" prop="steeringTitleB" show-overflow-tooltip/>
      <el-table-column label="标题B内容" align="center" prop="steeringContentB" show-overflow-tooltip/>
      <el-table-column label="把舵定向标题C" align="center" prop="steeringTitleC" show-overflow-tooltip/>
      <el-table-column label="标题C内容" align="center" prop="steeringContentC" show-overflow-tooltip/>
      <el-table-column label="培根铸魂首页背景图" align="center" prop="soulCastingIndexBg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingIndexBg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂首页大标题" align="center" prop="soulCastingIndexMainTitle" show-overflow-tooltip/>
      <el-table-column label="培根铸魂首页小标题" align="center" prop="soulCastingIndexSubTitle" show-overflow-tooltip/>
      <el-table-column label="培根铸魂首页内容A" align="center" prop="soulCastingIndexContentA" show-overflow-tooltip/>
      <el-table-column label="培根铸魂首页内容B" align="center" prop="soulCastingIndexContentB" show-overflow-tooltip/>
      <el-table-column label="培根铸魂首页内容C" align="center" prop="soulCastingIndexContentC" show-overflow-tooltip/>
      <el-table-column label="培根铸魂第1页背景图" align="center" prop="soulCastingPage1Bg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage1Bg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第1页标题" align="center" prop="soulCastingPage1Title" show-overflow-tooltip/>
      <el-table-column label="培根铸魂第1页图片" align="center" prop="soulCastingPage1Img" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage1Img" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第1页内容" align="center" prop="soulCastingPage1Content" show-overflow-tooltip/>
      <el-table-column label="培根铸魂第2页背景图" align="center" prop="soulCastingPage2Bg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage2Bg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第2页标题A" align="center" prop="soulCastingPage2TitleA" show-overflow-tooltip/>
      <el-table-column label="培根铸魂第2页图片A" align="center" prop="soulCastingPage2ImgA" width="100" >
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage2ImgA" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第2页标题B" align="center" prop="soulCastingPage2TitleB" show-overflow-tooltip/>
      <el-table-column label="培根铸魂第2页图片B" align="center" prop="soulCastingPage2ImgB" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage2ImgB" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第3页背景图" align="center" prop="soulCastingPage3Bg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage3Bg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第3页标题" align="center" prop="soulCastingPage3Title" show-overflow-tooltip/>
      <el-table-column label="培根铸魂第3页主图" align="center" prop="soulCastingPage3MainImg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage3MainImg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第3页副图A" align="center" prop="soulCastingPage3SubImgA" width="100" show-overflow-tooltip>
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage3SubImgA" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第3页副图B" align="center" prop="soulCastingPage3SubImgB" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage3SubImgB" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第3页副图C" align="center" prop="soulCastingPage3SubImgC" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage3SubImgC" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第3页副图D" align="center" prop="soulCastingPage3SubImgD" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage3SubImgD" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第3页副图E" align="center" prop="soulCastingPage3SubImgE" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.soulCastingPage3SubImgE" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="培根铸魂第3页内容" align="center" prop="soulCastingPage3Content" show-overflow-tooltip/>
      <el-table-column label="强基固本背景图" align="center" prop="foundationStrengtheningBg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.foundationStrengtheningBg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="强基固本大标题" align="center" prop="foundationStrengtheningMainTitle" show-overflow-tooltip/>
      <el-table-column label="强基固本小标题" align="center" prop="foundationStrengtheningSubTitle" show-overflow-tooltip/>
      <el-table-column label="强基固本内容" align="center" prop="foundationStrengtheningContent" show-overflow-tooltip/>
      <el-table-column label="强基固本标题A" align="center" prop="foundationStrengtheningTitleA" show-overflow-tooltip/>
      <el-table-column label="强基固本标题A内容" align="center" prop="foundationStrengtheningContentA" show-overflow-tooltip/>
      <el-table-column label="强基固本标题B" align="center" prop="foundationStrengtheningTitleB" show-overflow-tooltip/>
      <el-table-column label="强基固本标题B内容" align="center" prop="foundationStrengtheningContentB" show-overflow-tooltip/>
      <el-table-column label="强基固本标题C" align="center" prop="foundationStrengtheningTitleC" show-overflow-tooltip/>
      <el-table-column label="强基固本标题C内容" align="center" prop="foundationStrengtheningContentC" show-overflow-tooltip/>
      <el-table-column label="强基固本标题D" align="center" prop="foundationStrengtheningTitleD" show-overflow-tooltip/>
      <el-table-column label="强基固本标题D内容" align="center" prop="foundationStrengtheningContentD" show-overflow-tooltip/>
      <el-table-column label="凝心聚力背景" align="center" prop="cohesionBg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.cohesionBg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="凝心聚力大标题" align="center" prop="cohesionBigTitle" show-overflow-tooltip/>
      <el-table-column label="凝心聚力小标题" align="center" prop="cohesionSubTitle" show-overflow-tooltip/>
      <el-table-column label="凝心聚力内容A" align="center" prop="cohesionContentA" show-overflow-tooltip/>
      <el-table-column label="凝心聚力内容B" align="center" prop="cohesionContentB" show-overflow-tooltip/>
      <el-table-column label="凝心聚力内容C" align="center" prop="cohesionContentC" show-overflow-tooltip/>
      <el-table-column label="提质增效背景" align="center" prop="efficiencyBg" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.efficiencyBg" :width="50" :height="50"/>
        </template>
      </el-table-column>
      <el-table-column label="提质增效" align="center" prop="efficiencyImprovement" show-overflow-tooltip/>
      <el-table-column label="提质增效标题" align="center" prop="efficiencyImprovementSlogan" show-overflow-tooltip/>
      <el-table-column label="提质增效小标题" align="center" prop="efficiencyImprovementMainTitle" show-overflow-tooltip />
      <el-table-column label="提质增效内容" align="center" prop="efficiencyImprovementContent" show-overflow-tooltip/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['dash:building:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['dash:building:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

   <!-- 添加或修改党建对话框 -->
<el-dialog :title="title" :visible.sync="open" :width="'90%'" append-to-body>
  <el-form ref="form" :model="form" :rules="rules" label-width="80px">
    <!-- 第一行：4个表单项 -->
    <el-divider content-position="left" style="color: #666; font-size: 14px;">党建首页</el-divider>
    <el-row :gutter="20" class="mb-4">
      <el-col :span="8">
        <el-form-item label="首页标题" prop="indexTitle">
          <el-input v-model="form.indexTitle" placeholder="请输入首页标题" />
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item label="首页内容">
          <editor v-model="form.indexContent" :min-height="100"/>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="首页背景" prop="partyBuildingIndexBg"  >
          <image-upload v-model="form.partyBuildingIndexBg"/>
        </el-form-item>
      </el-col>
    </el-row>

    <el-divider content-position="left" style="color: #666; font-size: 14px;">党建首页按钮</el-divider>

    <el-row :gutter="20" class="mb-4">
      <el-col :span="12">
        <el-form-item label="背景图" prop="indexBtnBg"  >
          <image-upload v-model="form.indexBtnBg"/>
        </el-form-item>
      </el-col>
    </el-row>
    <!-- 第二行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="按钮_A" prop="btnA">
          <el-input v-model="form.btnA" placeholder="请输入按钮_A" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="按钮_B" prop="btnB">
          <el-input v-model="form.btnB" placeholder="请输入按钮_B" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="按钮_C" prop="btnC">
          <el-input v-model="form.btnC" placeholder="请输入按钮_C" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="按钮_D" prop="btnD">
          <el-input v-model="form.btnD" placeholder="请输入按钮_D" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="按钮_E" prop="btnE">
          <el-input v-model="form.btnE" placeholder="请输入按钮_E" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="按钮_F" prop="btnF">
          <el-input v-model="form.btnF" placeholder="请输入按钮_F" />
        </el-form-item>
      </el-col>
    </el-row>
   <el-divider content-position="left" style="color: #666; font-size: 16px;">把舵定向</el-divider>
    <!-- 第三行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="12">
        <el-form-item label="把舵定向背景图" prop="steeringBg">
          <image-upload v-model="form.steeringBg"/>
        </el-form-item>
      </el-col>
    </el-row>

  <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="大标题" prop="steeringTitle">
          <el-input v-model="form.steeringTitle" placeholder="请输入把舵定向大标题" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="小标题" prop="steeringSlogan">
          <el-input v-model="form.steeringSlogan" placeholder="请输入把舵定向小标题" />
        </el-form-item>
      </el-col>
      
    </el-row>

    <!-- 第四行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="定向A标题" prop="steeringTitleA">
          <el-input v-model="form.steeringTitleA" placeholder="请输入定向A标题" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="标题A内容" prop="steeringContentA">
          <el-input v-model="form.steeringContentA" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="定向B标题" prop="steeringTitleB">
          <el-input v-model="form.steeringTitleB" placeholder="请输入定向B标题" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="标题B内容" prop="steeringContentB">
          <el-input v-model="form.steeringContentB" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
    </el-row>

    <!-- 第五行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="定向C标题" prop="steeringTitleC">
          <el-input v-model="form.steeringTitleC" placeholder="请输入把舵定向C标题" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="标题C内容" prop="steeringContentC">
          <el-input v-model="form.steeringContentC" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
    </el-row>

    <el-divider content-position="left" style="color: #666; font-size: 16px;">培根铸魂</el-divider>
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="首页背景" prop="soulCastingIndexBg">
          <image-upload v-model="form.soulCastingIndexBg"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="大标题" prop="soulCastingIndexMainTitle">
          <el-input v-model="form.soulCastingIndexMainTitle" placeholder="请输入培根铸魂首页大标题" />
        </el-form-item>
      </el-col>
       <el-col :span="6">
        <el-form-item label="小标题" prop="soulCastingIndexSubTitle">
          <el-input v-model="form.soulCastingIndexSubTitle" placeholder="请输入培根铸魂首页小标题" />
        </el-form-item>
      </el-col>
    </el-row>
    <!-- 第六行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="首页内容A" prop="soulCastingIndexContentA">
          <el-input v-model="form.soulCastingIndexContentA" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="首页内容B" prop="soulCastingIndexContentB">
          <el-input v-model="form.soulCastingIndexContentB" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="首页内容C" prop="soulCastingIndexContentC">
          <el-input v-model="form.soulCastingIndexContentC" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
    </el-row>

    <el-divider content-position="left" style="color: #666; font-size: 16px;">培根铸魂各页内容</el-divider>

    <!-- 第七行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="2-1背景图" prop="soulCastingPage1Bg">
          <image-upload v-model="form.soulCastingPage1Bg"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="2-1标题" prop="soulCastingPage1Title">
          <el-input v-model="form.soulCastingPage1Title" placeholder="请输入培根铸魂第1页标题" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="2-1图片" prop="soulCastingPage1Img">
          <image-upload v-model="form.soulCastingPage1Img"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="2-1内容" prop="soulCastingPage1Content">
          <el-input v-model="form.soulCastingPage1Content" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
    </el-row>

    <el-divider content-position="left" style="color: #666; font-size: 14px;">培根铸魂2-2页</el-divider>
    <!-- 第八行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="2-2页背景" prop="soulCastingPage2Bg">
          <image-upload v-model="form.soulCastingPage2Bg"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="2-2页标题A" prop="soulCastingPage2TitleA">
          <el-input v-model="form.soulCastingPage2TitleA" placeholder="请输入培根铸魂第2页标题A" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="2-2页图片A" prop="soulCastingPage2ImgA">
          <image-upload v-model="form.soulCastingPage2ImgA"/>
        </el-form-item>
      </el-col>
     
    </el-row>
    <el-row :gutter="20" class="mb-4">
       <el-col :span="6">
        <el-form-item label="2-2页标题B" prop="soulCastingPage2TitleB">
          <el-input v-model="form.soulCastingPage2TitleB" placeholder="请输入2-2页标题B" />
        </el-form-item>
      </el-col>
       <el-col :span="6">
        <el-form-item label="2-2页图片B" prop="soulCastingPage2ImgB">
          <image-upload v-model="form.soulCastingPage2ImgB"/>
        </el-form-item>
      </el-col>
    </el-row>
    <el-divider content-position="left" style="color: #666; font-size: 14px;">培根铸魂3-3页</el-divider>
    <!-- 第九行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
     
      <el-col :span="6">
        <el-form-item label="3-3页背景图" prop="soulCastingPage3Bg">
          <image-upload v-model="form.soulCastingPage3Bg"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="3-3页标题" prop="soulCastingPage3Title">
          <el-input v-model="form.soulCastingPage3Title" placeholder="请输入培根铸魂第3页标题" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="3-3页主图" prop="soulCastingPage3MainImg">
          <image-upload v-model="form.soulCastingPage3MainImg"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="3-3页图A" prop="soulCastingPage3SubImgA">
          <image-upload v-model="form.soulCastingPage3SubImgA"/>
        </el-form-item>
      </el-col>
    </el-row>

    <!-- 第十行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      
      <el-col :span="6">
        <el-form-item label="3-3页副图B" prop="soulCastingPage3SubImgB">
          <image-upload v-model="form.soulCastingPage3SubImgB"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="3-3页副图C" prop="soulCastingPage3SubImgC">
          <image-upload v-model="form.soulCastingPage3SubImgC"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="3-3页副图D" prop="soulCastingPage3SubImgD">
          <image-upload v-model="form.soulCastingPage3SubImgD"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="3-3页副图E" prop="soulCastingPage3SubImgE">
          <image-upload v-model="form.soulCastingPage3SubImgE"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="3-3页内容">
          <el-input v-model="form.soulCastingPage3Content" :min-height="192"/>
        </el-form-item>
      </el-col>
    </el-row>
    <el-divider content-position="left" style="color: #666; font-size: 16px;">强基固本</el-divider>
    <!-- 第十一行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      
      <el-col :span="6">
        <el-form-item label="背景图" prop="foundationStrengtheningBg">
          <image-upload v-model="form.foundationStrengtheningBg"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="大标题" prop="foundationStrengtheningMainTitle">
          <el-input v-model="form.foundationStrengtheningMainTitle" placeholder="请输入强基固本大标题" />
        </el-form-item>
      </el-col>
       <el-col :span="6">
        <el-form-item label="小标题" prop="foundationStrengtheningSubTitle">
          <el-input v-model="form.foundationStrengtheningSubTitle" placeholder="请输入强基固本小标题" />
        </el-form-item>
      </el-col>
    </el-row>

    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="强基内容">
          <el-input v-model="form.foundationStrengtheningContent" :min-height="192"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="标题A" prop="foundationStrengtheningTitleA">
          <el-input v-model="form.foundationStrengtheningTitleA" placeholder="请输入强基固本标题A" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="标题A内容" prop="foundationStrengtheningContentA">
          <el-input v-model="form.foundationStrengtheningContentA" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
    </el-row>

    <!-- 第十三行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="标题B" prop="foundationStrengtheningTitleB">
          <el-input v-model="form.foundationStrengtheningTitleB" placeholder="请输入强基固本标题B" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="标题B内容" prop="foundationStrengtheningContentB">
          <el-input v-model="form.foundationStrengtheningContentB" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="强基标题C" prop="foundationStrengtheningTitleC">
          <el-input v-model="form.foundationStrengtheningTitleC" placeholder="请输入强基固本标题C" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="强基标题C内容" prop="foundationStrengtheningContentC">
          <el-input v-model="form.foundationStrengtheningContentC" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
    </el-row>

    <!-- 第十四行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="强基固本标题D" prop="foundationStrengtheningTitleD">
          <el-input v-model="form.foundationStrengtheningTitleD" placeholder="请输入强基固本标题D" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="强基固本标题D内容" prop="foundationStrengtheningContentD">
          <el-input v-model="form.foundationStrengtheningContentD" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
      
    </el-row>
    <el-divider content-position="left" style="color: #666; font-size: 16px;">凝心聚力</el-divider>
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="凝心聚力背景" prop="cohesionBg">
          <image-upload v-model="form.cohesionBg"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="凝心聚力大标题" prop="cohesionBigTitle">
          <el-input v-model="form.cohesionBigTitle" placeholder="请输入凝心聚力大标题" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="凝心聚力小标题" prop="cohesionSubTitle">
          <el-input v-model="form.cohesionSubTitle" placeholder="请输入凝心聚力小标题" />
        </el-form-item>
      </el-col>
    </el-row>
    <!-- 第十五行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      
      <el-col :span="6">
        <el-form-item label="凝心聚力内容A" prop="cohesionContentA">
          <el-input v-model="form.cohesionContentA" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="凝心聚力内容B" prop="cohesionContentB">
          <el-input v-model="form.cohesionContentB" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="凝心聚力内容C" prop="cohesionContentC">
          <el-input v-model="form.cohesionContentC" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-col>
    </el-row>
    <el-divider content-position="left" style="color: #666; font-size: 16px;">提质增效</el-divider>
    <!-- 第十六行：4个表单项 -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="6">
        <el-form-item label="提质增效背景" prop="efficiencyBg">
          <image-upload v-model="form.efficiencyBg"/>
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="提质增效" prop="efficiencyImprovement">
          <el-input v-model="form.efficiencyImprovement" placeholder="请输入提质增效" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="提质增效标题" prop="efficiencyImprovementSlogan">
          <el-input v-model="form.efficiencyImprovementSlogan" placeholder="请输入提质增效标题" />
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="提质增效小标题" prop="efficiencyImprovementMainTitle">
          <el-input v-model="form.efficiencyImprovementMainTitle" placeholder="请输入提质增效小标题" />
        </el-form-item>
      </el-col>
    </el-row>

    
    <!-- 第十八行：富文本编辑器单独一行（占满整行） -->
    <el-row :gutter="20" class="mb-4">
      <el-col :span="24">
        <el-form-item label="提质增效内容">
          <editor v-model="form.efficiencyImprovementContent" :min-height="192"/>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button type="primary" @click="submitForm">确 定</el-button>
    <el-button @click="cancel">取 消</el-button>
  </div>
</el-dialog>
  </div>
</template>

<script>
import { listBuilding, getBuilding, delBuilding, addBuilding, updateBuilding } from "@/api/dash/building"

export default {
  name: "Building",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 党建表格数据
      buildingList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        indexTitle: null,
        indexContent: null,
        indexBtnBg: null,
        btnA: null,
        btnB: null,
        btnC: null,
        btnD: null,
        btnE: null,
        btnF: null,
        steeringTitle: null,
        steeringSlogan: null,
        steeringTitleA: null,
        steeringContentA: null,
        steeringTitleB: null,
        steeringContentB: null,
        steeringTitleC: null,
        steeringContentC: null,
        soulCastingIndexMainTitle: null,
        soulCastingIndexSubTitle: null,
        soulCastingIndexContentA: null,
        soulCastingIndexContentB: null,
        soulCastingIndexContentC: null,
        soulCastingPage1Title: null,
        soulCastingPage1Content: null,
        soulCastingPage2TitleA: null,
        soulCastingPage2TitleB: null,
        soulCastingPage3Title: null,
        soulCastingPage3Content: null,
        foundationStrengtheningMainTitle: null,
        foundationStrengtheningSubTitle: null,
        foundationStrengtheningContent: null,
        foundationStrengtheningTitleA: null,
        foundationStrengtheningContentA: null,
        foundationStrengtheningTitleB: null,
        foundationStrengtheningContentB: null,
        foundationStrengtheningTitleC: null,
        foundationStrengtheningContentC: null,
        foundationStrengtheningTitleD: null,
        foundationStrengtheningContentD: null,
        cohesionBigTitle: null,
        cohesionSubTitle: null,
        cohesionContentA: null,
        cohesionContentB: null,
        cohesionContentC: null,
        efficiencyImprovement: null,
        efficiencyImprovementSlogan: null,
        efficiencyImprovementMainTitle: null,
        efficiencyImprovementContent: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询党建列表 */
    getList() {
      this.loading = true
      listBuilding(this.queryParams).then(response => {
        this.buildingList = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        partyBuildingIndexBg: null,
        indexTitle: null,
        indexContent: null,
        indexBtnBg: null,
        btnA: null,
        btnB: null,
        btnC: null,
        btnD: null,
        btnE: null,
        btnF: null,
        steeringBg: null,
        steeringTitle: null,
        steeringSlogan: null,
        steeringTitleA: null,
        steeringContentA: null,
        steeringTitleB: null,
        steeringContentB: null,
        steeringTitleC: null,
        steeringContentC: null,
        soulCastingIndexBg: null,
        soulCastingIndexMainTitle: null,
        soulCastingIndexSubTitle: null,
        soulCastingIndexContentA: null,
        soulCastingIndexContentB: null,
        soulCastingIndexContentC: null,
        soulCastingPage1Bg: null,
        soulCastingPage1Title: null,
        soulCastingPage1Img: null,
        soulCastingPage1Content: null,
        soulCastingPage2Bg: null,
        soulCastingPage2TitleA: null,
        soulCastingPage2ImgA: null,
        soulCastingPage2TitleB: null,
        soulCastingPage2ImgB: null,
        soulCastingPage3Bg: null,
        soulCastingPage3Title: null,
        soulCastingPage3MainImg: null,
        soulCastingPage3SubImgA: null,
        soulCastingPage3SubImgB: null,
        soulCastingPage3SubImgC: null,
        soulCastingPage3SubImgD: null,
        soulCastingPage3SubImgE: null,
        soulCastingPage3Content: null,
        foundationStrengtheningBg: null,
        foundationStrengtheningMainTitle: null,
        foundationStrengtheningSubTitle: null,
        foundationStrengtheningContent: null,
        foundationStrengtheningTitleA: null,
        foundationStrengtheningContentA: null,
        foundationStrengtheningTitleB: null,
        foundationStrengtheningContentB: null,
        foundationStrengtheningTitleC: null,
        foundationStrengtheningContentC: null,
        foundationStrengtheningTitleD: null,
        foundationStrengtheningContentD: null,
        cohesionBg: null,
        cohesionBigTitle: null,
        cohesionSubTitle: null,
        cohesionContentA: null,
        cohesionContentB: null,
        cohesionContentC: null,
        efficiencyBg: null,
        efficiencyImprovement: null,
        efficiencyImprovementSlogan: null,
        efficiencyImprovementMainTitle: null,
        efficiencyImprovementContent: null,
        createTime: null,
        updateTime: null
      }
      this.resetForm("form")
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm")
      this.handleQuery()
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset()
      this.open = true
      this.title = "添加党建"
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset()
      const id = row.id || this.ids
      getBuilding(id).then(response => {
        this.form = response.data
        this.open = true
        this.title = "修改党建"
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateBuilding(this.form).then(response => {
              this.$modal.msgSuccess("修改成功")
              this.open = false
              this.getList()
            })
          } else {
            addBuilding(this.form).then(response => {
              this.$modal.msgSuccess("新增成功")
              this.open = false
              this.getList()
            })
          }
        }
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids
      this.$modal.confirm('是否确认删除党建编号为"' + ids + '"的数据项？').then(function() {
        return delBuilding(ids)
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess("删除成功")
      }).catch(() => {})
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('dash/building/export', {
        ...this.queryParams
      }, `building_${new Date().getTime()}.xlsx`)
    }
  }
}
</script>
